package com.lvcoding.oauth2.single.controller;

import org.springframework.security.access.annotation.Secured;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wuyanshen
 * @discription 描述
 * @date 2021-02-21 下午7:41
 */
@RestController
public class UserController {


    @GetMapping("user")
    public String test() {
        return "user";
    }

    @GetMapping("admin")
    @PreAuthorize("hasAnyAuthority('u:admin:view')")
    public String admin() {
        return "admin";
    }
}
